! Artifice, an "experience" crafted in one week. This was primarily made as an example ! for a friend who dabbles in steampunk artifact manufacture, but became a submission to ! Week 1 of Interactive Fiction month. It's rather sloppily put together, and I'm certain ! it's buggy as all heck, but for one week of work, it suffices. Constant Story "ARTIFICE"; Constant Headline "^An Interactive Diversion^ by Paul J. Furio.^ Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.^ First time players should type 'about'. Type 'credits' for a credits listing.^"; Release 1; Constant IFID "20F8A019-7133-4722-BD65-B3012593CF14"; ! Alt Menu stuff Replace DoMenu; Replace LowKey_Menu; Constant ALTMENU_PROP_STUBS; Constant HINT_STYLE = 2; Constant TASKS_PROVIDED; Constant NUMBER_TASKS = 5; Constant MAX_SCORE = 5; Array task_scores -> 1 1 1 1 1; Constant MAX_TURNS = 5; Include "Parser"; Include "Verblib"; ! Special Hints and Menus Include "Utility"; Include "DoMenu"; Include "AltMenu"; Include "Hints"; Include "Howtoplay"; Include ">HintsMenu"; Global turn_tracker; Object MemoryGem "crystal shard" with name 'crystal' 'shard' 'memory' 'gem' 'schwarzchild' 'pink', description "An elongated crystal prism, with seven sides, vaguely pink in color.", before[; Drop: remove self; "The crystal falls to the floor and rolls away underneath some clutter of debris. It's unlikely you'll be able to find it again."; ], after[; self.WatsonReaction(); ], WatsonReaction[; if(self hasnt general) { give self general; "^~Ahh,~ Watson notes. ~You have the Schwarzchild Crystal! That should ensure some level of coherence in your memories between the temporal jumps. As long as you don't lose it, that is.~"; } "~Hold on to that thing, laddy!~ Watson cautions."; ]; Object dummyKey "dummy key" with name 'key'; Object Lab "Laboratory" with name 'debris' 'tools' 'devices', description "The Lab is its usual cluttered self, although the Apparatus takes up the largest amount of space. A workbench rests against a nearby wall, and a Faraday cage stands opposite, with various mechanical devices and tools scattered across the floor and at the base of a tool cabinet. The safety hatch has sealed shut, trapping both you and your assistant in with the humming Reciprocator.", n_to hatch, cant_go "The only exit is the hatch, which is sealed shut. You're stuck in here for now.", has light; Object -> hatch "safety hatch" with name 'hatch' 'safety' 'door', description "Sealed shut, as a safety measure.", door_dir n_to, with_key dummyKey, has openable ~open locked lockable scenery door; Object -> Watson "Watson", with name 'watson' 'scientist' 'assistant' 'man' 'stout' 'short' 'fellow', description "A short but stout fellow, Watson is your perennial assistant and fellow scientist.", describe[; if(self in Lab) "Watson scurries about franticly, looking under note papers and briefly examining spare parts."; else if(self in FaradayCage) "Watson peers anxiously through the copper bars of the Faraday cage."; "~Where am I?~ Watson wonders aloud."; ], life[; Attack: "Harming your assistant would be most counterproductive in this situation."; Kiss: "Quaint? Yes. Useful? Absolutely. Highly attractive? In the least."; WakeOther: "But Watson isn't asleep!"; ThrowAt: "Perhaps handing ",(the)noun," to Watson would be more productive."; Give: "~What in the devil would I do with that?~ Watson asks."; Show: if(noun == MemoryGem) return MemoryGem.WatsonReaction(); "~Yes, yes, I've seen ",(the)noun," plenty. I work in this lab too, you know!~ Watson answers, exasperated."; Ask: switch(second) { 'apparatus','reciprocator','device','time','machine','temporal': "~Of course the intent was to use a pigeon or rat as the initial test subject, but I suppose we're about to become part of our own experiment. I only wonder if we'll remember the experience.~"; 'faraday','cage','copper','portcullis': if(self in FaradayCage) "~I should be quite safe in here, thank you!~"; else "~Ah yes, perhaps one of the levers within could be put to good use. Wasn't the activator for the portcullis somewhere on the desk?~"; 'plasma','ball','upper': "~That AEtheric sphere will warrant quite a bit of further study, assuming it doesn't implode and destroy the Universe in the process!~"; 'lever','brass','silver','gold': "~There are three levers within the Faraday cage. Of course, I never can remember which does what.~"; 'activation','rod': "~Yes, if we could dislodge the activation rod as easily as you knocked it into the Apparatus, we would be out of this mess in a split jiffy!~"; 'cap','capacitor','red','button','pump','aetheric': "~Have you forgotten so soon? You must prime the capacitor before it will begin charging, my friend.~"; 'tool','cabinet','shelf','doors','rusty','metal': "~Quite a useless hunk of metal that thing is.~"; 'crystal','shard','memory','gem','schwarzchild','pink': "~The Schwarzchild Crystal should create a mild field of temporal coherence between the time jumps triggered by the Apparatus. But then, a cat in a closed box may stand a better chance of survival.~"; 'hatch','door': "~Well the purpose was to keep us safely outside, but it seems it's had quite the opposite effect!~"; default: "~I have no idea what you're talking about, dear friend.~"; } Tell: "~I'm sure this leads to an amusing story, but we haven't the time for fibble-fabble at the moment!~ Watson replies."; ], orders[; Pull, Push: if(self in FaradayCage) { switch(noun) { SilverLever: return PullSilverLever(); BrassLever: return PullBrassLever(); GoldLever: return PullGoldLever(); default: "~I'm not quite sure what you're referring to, old chap.~"; } } else "~Bloody well do it yourself!~"; ], has animate proper; Object -> FaradayCage "Faraday cage", with name 'faraday' 'cage' 'shield' 'metal' 'copper' 'gate' 'portcullis' 'hemp' 'ropes', description[; print "The Faraday cage was welded by Watson himself, and resembles a large bird cage, a tall cylinder of polished copper bars with a domed top. The entrance is currently blocked by a portcullis hanging from hemp ropes which disappear into the ceiling."; if(Watson in self) " Watson stands within the cage, ready to activate the levers at your command."; " Within the cage, three long levers are attached to the floor."; ], before[; Open: "The portcullis to too heavy to lift by hand."; Push: <>; ], has container transparent openable scenery; Object -> -> SilverLever "silver lever", with name 'silver' 'lever' 'grip' 'levers', description "A long lever with a silver grip, hinged at the floor of the cage.", has static; Object -> -> BrassLever "brass lever", with name 'brass' 'lever' 'grip' 'levers', description "A long lever with a brass grip, hinged at the floor of the cage.", has static; Object -> -> GoldLever "golden lever", with name 'gold' 'golden' 'lever' 'grip' 'levers', description "A long lever with a golden grip, hinged at the floor of the cage.", has static; Object -> Apparatus "Apparatus", with name 'apparatus' 'device' 'temporal' 'reciprocator' 'time' 'machine', description "Nearly three meters tall, the Temporal Reciprocator dominates the laboratory. A glowing sphere of plasma spins quickly within the upper assembly, and the activation rod, with which you so clumsily collided only moments ago, has fallen into the device to make contact with the ignition circuit.", has scenery transparent; Object -> -> PlasmaSphere "plasma sphere", with name 'plasma' 'sphere' 'upper' 'assembly', description "A sphere of AEtheric Plasma, glowing and spinning as it builds up energy for the inevitable Temporal Leap. The sphere hums deeply, revealing the strange power contained within it.", has static; Object -> -> ActivationRod "activation rod", with name 'activation' 'rod' 'iron', description "An iron rod, perhaps a meter long, attached at one end to a think bundle of conductive cable. The other end of the rod rests upon the ignition circuit, well out of reach behind the safety barrier of the Apparatus.", before[; Take: "There's no way you'll be able to reach the activation rod by hand."; ], has static; Object -> Desk "workbench", with name 'desk' 'bench' 'workbench', description "Half desk, half workbench, various tools and apparatus are scattered across the flat surface. The front contains a large drawer, on top rests an AEtheric capacitor, and a wooden handle attached to some kind of cable protrudes forward from the rear of the workbench.", before[; Open: <>; Close: <>; ], has supporter transparent scenery; Object -> -> Drawer "drawer" with name 'drawer' 'large', has openable container ~open scenery; Object -> -> -> Parchment "piece of parchment", with name 'paper' 'parchment' 'map' 'piece' 'of', description "Ah yes, the overhead map of the lab. You recall drawing this up several weeks ago, although you cannot remember what experiment it was for. The map displays the Faraday cage at one side of the room, with numbered lines radiating away towards various other items. A line for the hatch is labeled 32, 71 for the Apparatus, the workbench line is labeled with the number 124, and the tool cabinet is numbered 173"; Object -> -> WoodHandle "wooden handle", with name 'wood' 'wooden' 'handle' 'hemp' 'cable' 'cord', description "A wooden handle, as if repurposed from a shovel or construction tool. Lines of hemp cord protrude from each end, connecting together in a thick knot. This cord disappears through a hole in the rear of the workbench, although you notice the same cord reappears behind the top edge of the bench and extends into the darkness above.", before[; Pull: if(Watson in Lab) { Achieved(1); move Watson to FaradayCage; "The portcullis of the Faraday cage raises with a mighty clanking.^ ~Of course!~ shouts Watson. ~The security of the cage and the devices within may be just the solution we require!~ He quickly ducks into the copper entrapment and activates a hidden release switch, slamming the gate shut behind him."; } else { "Pulling the cord has no further effect."; } ], has scenery; Object -> -> Capacator "capacitor", with name 'cap' 'capacitor' 'red' 'button' 'pump' 'aetheric', description "A squarish coiled dielectric capacitor of your own design, meant to gather energy from the Free AEther and store it for later use. A pump on the side is built in to allow priming, and a red button atop to discharge. The capacitor is firmly affixed to the desk surface, with heavy gauge wires extending from it across the floor towards the Faraday cage.", number 4, before[; Prime: if(self hasnt general) { Achieved(0); give self general; self.number = 4; "You prime the capacitor with a few quick pumps, and the indicator bar on the side begins to fill up as it gathers energy from the AEther."; } else "The capacitor has already been primed."; Push: if(self has general) { if(self.number == 0) return TestWin(); else "Pushing the button on the partly charged capacitor would have no effect."; } else "Nothing happens."; ], each_turn[; if(self has general) { if(self.number > 3) { self.number--; return; } if(self.number > 0) { print "The indicator on the capacitor shows that it is now "; switch(self.number) { 3: print "one-third"; 2: print "two-thirds"; 1: print "completely"; } self.number--; " full."; } } ], has scenery; Object -> toolshelf "tool cabinet" with name 'tool' 'cabinet' 'shelf' 'doors' 'rusty' 'metal', description[; if(self hasnt open) "A closed tool cabinet, made of sheet metal with rusty doors."; "A sheet metal tool cabinet, with doors wide open."; ], has scenery container openable ~open; Object -> -> screwdriver "screwdriver" with name 'driver' 'screwdriver', description "Your standard forged iron flathead screwdriver, eight inches long with a solid wooden handle. An emblem of a crimson fish is etched into the handle."; Object -> -> wrench "wrench" with name 'wrench', description "A wrench, of forged steel, although you're unsure of the gauge. An emblem of a crimson fish is etched into the handle."; Object UltraMagnet "electromagnet" with name 'magnet' 'electromagnet' 'mag' 'swivel', description[; print "Mounted to a swivel above the Faraday cage, this linear electromagnet was to be used for some kind of matter dispersal experiment, although you can nigh remember which one at this particular moment. Heavy gauge wires run off the side and into the darkness, and the magnet is currently aimed "; if(Dial.number < 32) "towards the wall near the hatch."; else if(Dial.number == 32) "directly at the hatch."; else if((Dial.number > 32)&&(Dial.number < 71)) "between the hatch and the Apparatus."; else if(Dial.number == 71) "directly at the Apparatus."; else if((Dial.number > 71)&&(Dial.number < 124)) "between the Apparatus and the workbench."; else if(Dial.number == 124) "directly at the workbench."; else if((Dial.number > 124)&&(Dial.number < 173)) "between the workbench and the tool cabinet."; else if(Dial.number == 173) "directly at the tool cabinet."; else "towards the wall near the tool cabinet."; ], before[; Turn: "The electromagnet is too far out of reach to turn directly."; ], has static; Object Dial "dial" with name 'dial' 'panel' 'rotary', number 173, description[; "A rotary dial, carved out of horn bone, and set into an ornate etched panel. Numbers range from 0 to 180 around the outer rim, and the dial is currently set to ",self.number,"."; ], before[; SetTo: <>; TurnToNum: if(second == self.number) "The dial is already set to ",second,"."; if((second < 0)||(second > 180)) "The dial can only be set to values between 0 and 180."; if(second == 71) Achieved(3); self.number = second; "The dial clicks softly as you set it to ",second,". Behind you, the magnet whirrs slightly as it rotates on the swivel."; ], has scenery; Object JacobsLadder "Jacobs Ladder" with name 'jacobs' 'ladder' 'spark' 'sparks', describe "The Jacobs Ladder sparks away noisily.", description "With twin antennae of metal about two meters tall, the spark generated at the base quickly rises between them, vanishing at the top with a cracking jolt, only to reform again at the bottom and repeat the process.", has static; !***************************************************************************** ! End of Object Definitions !***************************************************************************** [Initialise; hint_menu = Artifice_Hint_Menu; PreliminaryText(); VersionSub(); StartupText(); turn_tracker = 0; location = Lab; ! Set for final game move MemoryGem to player; return 2; ]; [PreliminaryText; print "^^^Somehow, you feel a strange sense of déjà vu.^^^"; ]; [StartupText; print "^~You fool!~ cries Watson. ~You've activated the Temporal Reciprocator! Now we'll be stuck in a time loop until we can deactivate it!~^"; ]; [TestWin; if(UltraMagnet in Lab) { print "The capacitor rapidly discharges, energizing the electromagnet. "; if(Dial.number == 71) { Achieved(4); deadflag = 2; !-- Win! "Aimed directly at the Apparatus, the powerful magnetic pulse causes the activation rod to dislodge from the ignition circuit with a mighty spark! Deprived of current, the plasma sphere pulses quickly, then pops like an ethereal balloon as the Apparatus whines down to silence.^ ~You've done it!~ exclaims Watson, freeing himself from the confines of the Faraday cage. ~Now we can finally get on to some real experimentation!~^"; } else if(Dial.number == 32) { "Pointing at the hatch, the electromagnet causes the doorway to groan slightly, but luckily the safety mechanisms hold the portal in place."; } else if(Dial.number == 124) { "Debris on the workbench flies off the surface and briefly levitates in mid-air as the focused magnetic field courses across the laboratory. A moment later, everything falls back to the desk with little grace and more clatter."; } else if(Dial.number == 173) { "The powerful magnetic field tosses the tool cabinet like a ragdoll, sending metal panels and screwdrivers rattling against the far wall. What once seemed messy is now a total disaster."; } else { "The magnetic pulse kicks various debris up into the air, but otherwise has no discernable effect."; } } else { print "The capacitor rapidly discharges, and behind a wall you hear a mighty jolt as the gathered power is rapidly grounded via a safety circuit."; } ]; [PullGoldLever; if(GoldLever has general) "~I've right pulled that one already, haven't I?~ states Watson."; give GoldLever general; move JacobsLadder to Lab; "Heaving mightily against the gold lever, Watson manages to cause a large Jacobs Ladder to emerge from behind the Faraday cage. The ladder begins sparking, arcs of lightning rising along the nearly parallel metal rods with a noisy electrical snap."; ]; [PullSilverLever; if(SilverLever has general) "~Why not, I've already pulled it once~ Watson states. Nothing new happens."; give SilverLever general; "Watson throws his weight into the silver lever, and a panel opens against a far wall. Immediately, dozens of sparkling white doves fly out and up through a skylight far above. Damn. Those birds were for a different experiment altogether."; ]; [PullBrassLever; if(BrassLever has general) "~Is pulling this damned lever over and over really going to help our situation?~ Watson asks franticly."; Achieved(2); give BrassLever general; move UltraMagnet to Lab; move Dial to Desk; "Pushing the brass lever firmly, a rod-shaped electromagnet emerges above the Faraday cage. The magnet appears attached to a swivel device, and is currently pointed at the tool rack. You notice an previously unseen panel has emerged from the desk, containing a rotary dial."; ]; [PrintTaskName task_number; switch(task_number){ 0: "priming the capacitor"; 1: "allowing Watson into the Faraday cage"; 2: "activating the magnet"; 3: "setting the dial to the correct angle"; 4: "deactivating the time machine"; } ]; [PrintRank; print ", earning you the rank of "; switch(score) { 5: "Nobel Prize Winning Physicist."; 4: "Head of University Research."; 3: "Tenured Professor of Science."; 2: "Undergraduate Degree Student."; 1: "Chemistry Set Tinkerer."; 0: "Bumbling Lab Assistant."; } ]; !********************************************************** ! Verb Subroutines !********************************************************** [AboutSub; print "^On-Line Hints and instructions are available by typing 'help'.^"; print "^Artifice is an ~Interactive Diversion~ originally intended for the entertainment of a select group of friends. It is a work of Interactive Fiction authored by Paul J. Furio, author of the 2004 IFComp 8th Place Winner, Splashdown.^^ Artifice by Paul J. Furio is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.^^ This game was designed and developed in one week, from Sunday February 15th 2009 through Saturday February 21st 2009. As such, it is clearly rough around the edges and incomplete, but it was an effort in ~Speed Interactive Fiction~, and a pleasant diversion from a hectic day-job schedule.^"; ]; [CreditsSub; VersionSub(); print "IFID: ", (string) IFID , "^^"; print"Artifice was designed, written, and developed by Paul J. Furio.^"; print "Developed with Inform v6.31 (Library 6/11) and IF-IDE version 0.72^ Thanks to Graham Nelson and Michael Perlini^"; ]; [InternalRestart i; print "[Press any key to continue.]^"; @read_char 1 -> i; @restart; ]; [DeathMessage; if(deadflag == 3) { print "There is a sudden ominous groan, followed by a blinding flash of light. ***^^^"; InternalRestart(); } if(deadflag == 4) print "You have been caught in an infinite time loop"; ]; !******************************** ! Custom Verb Subroutines !******************************* [PrimeSub; "I'm not sure how you can prime ",(the)noun,"."; ]; [TurnToNumSub; "I don't see how you can do that."; ]; [TimePasses; turn_tracker++; if(turn_tracker >= MAX_TURNS) { if(MemoryGem in player) deadflag = 3; else { print"^There is an ominous groan, during which you feel your mind clouding. Suddenly a bright light flashes."; deadflag = 4; } } ]; Include "Grammar"; !*************************************************** ! Custom Meta Verbs !*************************************************** Verb meta 'about' * -> About; Verb meta 'credits' * -> Credits; Verb 'prime' 'pump' 'use' 'operate' * noun -> Prime; Extend 'turn' * noun 'to' number -> TurnToNum; Extend 'rotate' * noun 'to' number -> TurnToNum; Extend 'twist' * noun 'to' number -> TurnToNum; Extend 'pull' * 'on' noun -> Pull; Extend 'push' * 'on' noun -> Push;